package com.cq.hd.common.response;

import com.cq.hd.common.enums.ResponseEnums;
import com.cq.hd.common.exception.BusinessException;
import com.cq.hd.common.exception.HttpExecuteException;
import com.cq.hd.common.exception.RpcCallException;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * @description: 抛异常
 * @author: mYunYu
 * @date: 2021/7/7 15:48
 * @version: v1.0
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Throw {
    public static void isRpcCallException(int code, String message) {
        throw new RpcCallException(code, message);
    }

    public static void isHttpExecuteException(int code, String message) {
        throw new HttpExecuteException(code, message);
    }

    public static void isBusinessException(int code, String message) {
        throw new BusinessException(code, message);
    }

    public static void isBusinessException(ResponseEnums responseEnums) {
        throw new BusinessException(responseEnums);
    }

    public static void isBusinessException(String message) {
        throw new BusinessException(message);
    }

}

